package com.allwees.bs.core.model.product.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.allwees.bs.core.modelbase.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

@Data
@EqualsAndHashCode(callSuper = true)
@ToString
@NoArgsConstructor
@MappedSuperclass
public class CategoryModel extends BaseEntity {
    public static final String TOP = "0";

    @Column(unique = true, length = 12)
    private String no;

    @Column(length = 12)
    @TableField(whereStrategy = FieldStrategy.NOT_EMPTY)
    private String parentNo;

    @Column(length = 64)
    @TableField(whereStrategy = FieldStrategy.NOT_EMPTY)
    private String parentUuid;

    @Column(length = 48)
    private String name;

    @Column(length = 24)
    private String nameZh;

    private String img;
}
